package com.chance.cc.crawler.development.command.trigger.domain.baidu;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.BaiDuCommonScript;
import com.chance.cc.crawler.development.command.job.domain.baidu.realtime.BaiDuPostBarRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.realtime.BaiDuTieBaRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.trace.BaiDuPostBarTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.trace.BaiDuTieBaCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.baidu.trace.BaiDuTieBaTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.CommonCrawlerTestSchedulerTrigger;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2021-03-30 10:46:56
 * @email okprog@sina.com
 */
public class BaiDuTieBaCrawlerScheduleTrigger extends CommonCrawlerTestSchedulerTrigger {
    public static void main(String[] args) {

        publishBaiDuTieBaRealtimeCrawlerScheduleTriggerInfo();

        publishBaiDuTieBaTraceCrawlerScheduleTriggerInfo();

        publishBaiDuTieBaCommentTraceCrawlerScheduleTriggerInfo();

//        publishBaiDuPostBarRealtimeCrawlerScheduleTriggerInfo();
//
//        publishBaiDuPostBarTraceCrawlerScheduleTriggerInfo();

    }

    /**
     * 发布百度贴吧关键词2小时采集实时任务trigger info

     */
    public static void publishBaiDuTieBaRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiDuTieBaRealtimeCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/30 * * * ?",
                "百度贴吧关键词实时采集任务执行，每三十分钟执行一次"
        );
    }

    /**
     * 发布百度贴吧关键词采集回溯任务trigger info

     */
    public static void publishBaiDuTieBaTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiDuTieBaTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 * * ?",
                "百度贴吧关键词24小时回溯采集任务执行，每天执行一次"
        );
    }
    /**
     * 发布百度贴吧关键词采集评论回溯任务trigger info

     */
    public static void publishBaiDuTieBaCommentTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiDuTieBaCommentTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "百度贴吧关键词24小时回溯采集任务执行，每小时执行一次"
        );
    }

    /**
     * 发布百度贴吧按贴吧关键词2小时采集实时任务trigger info

     */
    public static void publishBaiDuPostBarRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiDuPostBarRealtimeCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/2 * * ?",
                "百度贴吧按贴吧关键词实时采集任务执行，每两小时执行一次"
        );
    }

    /**
     * 发布百度贴吧按贴吧关键词采集回溯任务trigger info

     */
    public static void publishBaiDuPostBarTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BaiDuPostBarTraceCrawlerSchedulerJob.crawlerScheduler();

        metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0 * * ?",
                "百度贴吧按贴吧关键词24小时回溯采集任务执行，每天执行一次"
        );
    }
}
